package daily.commons

/**

 * User: zjzhai
 * Date: 10/10/13
 * Time: 8:55 PM

 */
public enum Month {

    JANUARY('Jan'),
    FEBRUARY('Feb'),
    MARCH('Mar'),
    APRIL('Apr'),
    MAY('May'),
    JUNE('Jun'),
    JULY('Jul'),
    AUGUST('Aug'),
    SEPTEMBER('Sep'),
    OCTOBER('Oct'),
    NOVEMBER('Nov'),
    DECEMBER('Dec');

    private final String shortName;
    private Month(String shortName){
        this.shortName = shortName;
    }
    public String getShortName(){
        this.shortName;
    };

    static int numberofShortName(String monthShortName){
        for(Month month : Month.values()){
            if(month.shortName.equals(monthShortName.trim())){
                 return month.ordinal();
            }
        }

      throw new  RuntimeException('monthShortName is disavaild')
    }

}